package ltd.smallwang;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * @author justd
 * @date 2024-10-02 09:47
 */
class Leetcode0274Test {

  private final Leetcode0274 leetcode0274 = new Leetcode0274();

  @Test
  void hIndex01() {
    Assertions.assertThat(leetcode0274.hIndex(new int[]{3, 0, 6, 1, 5})).isEqualTo(3);
  }

  @Test
  void hIndex02() {
    Assertions.assertThat(leetcode0274.hIndex(new int[]{1, 3, 1})).isEqualTo(1);
  }

  @Test
  void hIndex03() {
    Assertions.assertThat(leetcode0274.hIndex(new int[]{1})).isEqualTo(1);
  }

  @Test
  void hIndex04() {
    Assertions.assertThat(leetcode0274.hIndex(new int[]{2, 2, 2})).isEqualTo(2);
  }

  @Test
  void hIndex05() {
    Assertions.assertThat(leetcode0274.hIndex(new int[]{0})).isEqualTo(0);
  }
}